﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ExtractFiles
{
    public partial class HowToSearchFiles : HowtoParent
    {
        private int currentPage = 1;
        private int firstPage = 2;
        private int maxPage = 7;

        public HowToSearchFiles()
        {
            InitializeComponent();
        }

        protected override void howToSearchFilesPrevBtn_Click(object sender, EventArgs e)
        {
            if (currentPage == firstPage)
            {
                displayFirstPageControls();
            }
            else
            {
                displayNormalPageControls();
            }
            currentPage -= 1;
            displayPage();
        }

        protected override void howToSearchFilesNextBtn_Click(object sender, EventArgs e)
        {
            if (currentPage == maxPage)
            {
                displayLastPageControls();
            }
            else
            {
                displayNormalPageControls();
            }
            currentPage += 1;
            displayPage();
        }

        protected override void displayPage()
        {
            switch (currentPage)
            {
                case 1:
                    this.searchFilesStep1Label.Text = "Step " + currentPage + ": Select \"Search Files\" tab";
                    this.selectSearchFilesTabPictureBox.Image = global::ExtractFiles.Properties.Resources.howtosearchfilestab;
                    this.howToSearchFilesInstructionBox.Text = "Step " + currentPage + ": Select the \"Search Files\" tab to perform search for the files with partic" +
    "ular file names.\n\nClick \"Next\" to continue.";
                    break;
                case 2:
                    this.searchFilesStep1Label.Text = "Step " + currentPage + ": Browse for source directory";
                    this.selectSearchFilesTabPictureBox.Image = global::ExtractFiles.Properties.Resources.howtosearchfilessrcdir;
                    this.howToSearchFilesInstructionBox.Text = "Step " + currentPage + ": Browse for the directory which contains the files including those that may contain the names that you would like to search for.\n\nClick \"Next\" to continue.";
                    break;
                case 3:
                    this.searchFilesStep1Label.Text = "Step " + currentPage + ": Browse for file names to search";
                    this.selectSearchFilesTabPictureBox.Image = global::ExtractFiles.Properties.Resources.howtosearchfilestosearchfile;
                    this.howToSearchFilesInstructionBox.Text = "Step " + currentPage + ": Browse for the file which contains a list of file names that you would like to search for. This file must be a text file of type .txt. The file names written inside this file should also contain a file extension. For example, \"abc.txt\".\n\nClick \"Next\" to continue.";
                    break;
                case 4:
                    this.searchFilesStep1Label.Text = "Step " + currentPage + ": Set the filter of the file types to search for";
                    this.selectSearchFilesTabPictureBox.Image = global::ExtractFiles.Properties.Resources.howtosearchfilesfilter;
                    this.howToSearchFilesInstructionBox.Text = "Step " + currentPage + ": Indicate the filter of the file type to search for. You can include multiple filters if you are searching for different file types. Deliminate each filter with a comma (,), so do not include a comma in the filter itself.\n\nClick \"Next\" to continue.";
                    break;
                case 5:
                    this.searchFilesStep1Label.Text = "Step " + currentPage + ": Browse for file to store result";
                    this.selectSearchFilesTabPictureBox.Image = global::ExtractFiles.Properties.Resources.howtosearchfilesresultpath;
                    this.howToSearchFilesInstructionBox.Text = "Step " + currentPage + ": Browse for the file where you wish to store the list of search results. The file must be created first to be selected.\n\nClick \"Next\" to continue.";
                    break;
                case 6:
                    this.searchFilesStep1Label.Text = "Step " + currentPage + ": Browse for copied files destination directory";
                    this.selectSearchFilesTabPictureBox.Image = global::ExtractFiles.Properties.Resources.howtosearchfilesdestdir;
                    this.howToSearchFilesInstructionBox.Text = "Step " + currentPage + ": Browse for the directory where you want to copy the files that match the search name criteria to.\n\nClick \"Next\" to continue.";
                    break;
                case 7:
                    this.searchFilesStep1Label.Text = "Step " + currentPage + ": Search now!";
                    this.selectSearchFilesTabPictureBox.Image = global::ExtractFiles.Properties.Resources.howtosearchfilessavebtn;
                    this.howToSearchFilesInstructionBox.Text = "Step " + currentPage + ": Click the \"Search\" button and a list of result will be populated in the list box above.\n\nClick \"Next\" to continue.";
                    break;
                case 8:
                    this.searchFilesStep1Label.Text = "Step " + currentPage + ": Copy files now!";
                    this.selectSearchFilesTabPictureBox.Image = global::ExtractFiles.Properties.Resources.howtosearchfilescopybtn;
                    this.howToSearchFilesInstructionBox.Text = "Step " + currentPage + ": Click the \"Copy\" button to copy the files where the file names match your search criteria.";
                    break;
            }
        }
    }
}
